package com.soushangxing.comfyuibackendv2.config
import com.aliyun.oss.OSS
import com.aliyun.oss.OSSClientBuilder
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

/**
 * 阿里云配置
 */
@Configuration
class AliyunConfig {
    @Value("\${aliyun.oss.endpoint}")
    lateinit var endpoint:String
    @Value("\${aliyun.oss.access-key-id}")
    lateinit var keyId: String
    @Value("\${aliyun.oss.access-key-secret}")
    lateinit var secretKey: String

    @Bean
    fun getOss():OSS{
        return OSSClientBuilder().build(endpoint, keyId, secretKey)
    }

}
